home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 60.zip / BS1 part 60 / protext d1.adf / Install_Protext < prev    next >
Text File  |  1993-11-24  |  5KB  |  215 lines

  1. (welcome "Protext 6.1 Hard Disk Installation")
  2.  
  3. (procedure nothing (set dummy 0))
  4.  
  5. (set progdisk "Protext6-Program"
  6. ppddisk "Protext6-Printers"
  7. dictdisk "Protext6-Dictionary"
  8. thesdisk "Protext6-Thesaurus"
  9. m_plsinsert "\n\nPlease insert %s Disk" 
  10. )
  11.  
  12. ; Need to init u-destpath and u-srcpath for this code
  13.  
  14. (procedure arnorcopydisk (
  15.     (foreach u-srcpath "#?"
  16.         (set u-docopy 0)
  17.         (if (< @each-type 0)
  18.             ( ; file, not a directory
  19.                 (set u-srcname (tackon u-srcpath @each-name))
  20.                 (if (patmatch "#?.((gpd)|(ppd))" @each-name)
  21.                     (set u-destname (tackon (tackon u-destpath "ppd") @each-name))
  22.                     (if (patmatch "#?.((lex)|(qic)|(exl)|(env)|(hyp)|(ths))" @each-name)
  23.                         (set u-destname (tackon (tackon u-destpath "lex") @each-name))
  24.                         (set u-destname (tackon u-destpath @each-name))
  25.                     )
  26.                 )
  27.                 (if (or
  28.                         (or (patmatch "((install#?)|(#?.bak))" @each-name)
  29.                             (patmatch "((disk.info)|(.backdrop))" @each-name))
  30.                         (and (patmatch "protext.cfg" @each-name)
  31.                             (exists u-destname))
  32.                     )
  33.                     (set u-docopy 0)
  34.                     (
  35.                         (if (or (not g-update) (not (exists u-destname)))
  36.                             (set u-docopy 1)
  37.                             ( ; else dest does exist
  38.                                 (if (earlier u-srcname u-destname)
  39.                                     (set u-docopy 0)
  40.                                     (
  41.                                         (if (<> (getsize u-destname)
  42.                                                 (getsize u-srcname)
  43.                                             )
  44.                                             (set u-docopy 2)
  45.                                         )
  46.                                     )
  47.                                 )
  48.                             )
  49.                         )
  50.                     )
  51.                 )
  52.             )
  53.         )
  54.         (if u-docopy
  55.             (
  56.                 (copyfiles
  57.                     (source u-srcname)
  58.                     (dest (pathonly u-destname))
  59.                 )
  60.                 (if (patmatch "#?.info" @each-name)
  61.                     (tooltype
  62.                         (dest u-destname)
  63.                         (noposition)
  64.                     )
  65.                 )
  66.             )
  67.         )
  68.     )
  69. ))
  70.  
  71.  
  72. (procedure oldfilestuff (
  73.     (set tmp (tackon @default-dest "ppd"))
  74.     (if (exists tmp)
  75.         (
  76.             (delete (tackon tmp "#?.cpd"))
  77.             (rename tmp (tackon @default-dest "ppd.old"))
  78.         )
  79.     )
  80. ))
  81.  
  82. (if
  83.     (askbool
  84.         (prompt "\nDo you want to carry out a full installation\n"
  85.                 "or update an existing version of Protext?\n\n"
  86.                 "Selecting `Full Installation' will copy all files.\n\n"
  87.                 "Selecting `Update' will only copy newer files on top of older files.\n\n"
  88.                 "Both options will preserve your configuration settings.")
  89.         (help "No more help here")
  90.         (choices "Full Installation" "Update Only")
  91.     )
  92.     (set g-update 0 g-msg "install")
  93.     (set g-update 1 g-msg "update")
  94. )
  95.  
  96. (set @default-dest (tackon @default-dest "Protext"))
  97. (if (= 1 (exists @default-dest))
  98.     (rename @default-dest (cat @default-dest ".old"))
  99. )
  100.  
  101. (until space-ok
  102.     (if
  103.         (askbool
  104.             (prompt
  105.                 ("\nSuggested installation drawer is %s" @default-dest)
  106.             )
  107.             (help "Select `Proceed' if this drawer is OK and has at least 3Mb of free disk space, otherwise select `Change' or `Abort'.")
  108.             (choices "Proceed" "Change")
  109.         )
  110.         (nothing)
  111.         (
  112.             (set tmp
  113.                 (askdir
  114.                     (prompt "Which drawer do you wish to install into?")
  115.                     (help @askdir-help)
  116.                     (default @default-dest) 
  117.                     (newpath)
  118.                 )
  119.             )
  120.             (if (= (substr tmp (- (strlen tmp) 1)) ":")
  121.                 (set tmp (tackon tmp "Protext"))
  122.             )
  123.             (set @default-dest tmp)
  124.         )
  125.     )
  126.     (set space-ok (or g-update (>= (getdiskspace @default-dest) 3000000)))
  127.     (if (not space-ok)
  128.         (
  129.             (if
  130.                 (askbool
  131.                     (prompt "\n " (pathonly @default-dest)
  132.                             " does not have 3Mb of free space on it.\n\n" 
  133.                             "If you are installing on top of an existing copy of Protext, "
  134.                             "there may be enough disk space to proceed; "
  135.                             "otherwise select `Change' and choose another drive "
  136.                             "or delete some files." )
  137.                     (help "No more help here")
  138.                     (choices "Proceed" "Change")
  139.                 )
  140.                 (set space-ok 1)
  141.             )
  142.         )
  143.     )
  144. )
  145.  
  146. (message ("\n\nAbout to %s files to %s" g-msg @default-dest))
  147.  
  148. (if (not (exists @default-dest))
  149.     (makedir @default-dest
  150.         (infos)
  151.     )
  152. )
  153.  
  154. (set tmp ("Assign >NIL: PROTEXT: %s" @default-dest))
  155. (startup "Protext" 
  156.     (prompt "\nAdding the following line to S:user-startup\n\n" tmp)    
  157.     (help @startup-help)
  158.     (command tmp)
  159. )
  160.  
  161. (set tmp (tackon @default-dest "Protext"))
  162. (if (exists tmp)
  163.     (
  164.         (set xx (getversion tmp))
  165.         (set hi (/ xx 65536))
  166.         (if (<> hi 6)
  167.             ( ; copy old ppds if exists non v6 protext 
  168.                 (oldfilestuff)
  169.             )
  170.         )
  171.     )
  172. )
  173.  
  174. (set destpath @default-dest)
  175. (set u-destpath @default-dest)
  176.  
  177. (askdisk
  178.     (prompt (m_plsinsert progdisk))
  179.     (help @askdisk-help)
  180.     (dest progdisk)
  181. )
  182. (set u-srcpath (cat progdisk ":"))
  183. (arnorcopydisk)
  184. (copylib
  185.     (source (cat progdisk ":libs/asl.library"))
  186.     (dest "LIBS:")
  187. )
  188.  
  189. (askdisk
  190.     (prompt (m_plsinsert ppddisk))
  191.     (help @askdisk-help)
  192.     (dest ppddisk)
  193. )
  194. (set u-srcpath (cat ppddisk ":"))
  195. (arnorcopydisk)
  196.  
  197. (askdisk
  198.     (prompt (m_plsinsert dictdisk))
  199.     (help @askdisk-help)
  200.     (dest dictdisk)
  201. )
  202. (set u-srcpath (cat dictdisk ":"))
  203. (arnorcopydisk)
  204.  
  205. (askdisk
  206.     (prompt (m_plsinsert thesdisk))
  207.     (help @askdisk-help)
  208.     (dest thesdisk)
  209. )
  210. (set u-srcpath (cat thesdisk ":"))
  211. (arnorcopydisk)
  212.  
  213. (run (cat "cd " @default-dest))
  214. (run (tackon @default-dest "config") ("-i%s" @default-dest))
  215.